#!/bin/sh

# 生成镜像
usage() {
	echo "Usage: sh build.sh [jenkins_BUILD_NUMBER]"
	exit 1
}

BUILD_PATH='/var/lib/jenkins/workspace/RuoYiCloud/docker'
T_DATE=`date +'%Y%m%d'`

# build images
#echo "begin build ruoyi-ui"
#cd ${BUILD_PATH}/nginx && docker build -t harbor.xw.com/test/ruoyi-nginx:${T_DATE}_$1 .

echo "begin build ruoyi-gateway "
cd ${BUILD_PATH}/ruoyi/gateway && docker build -t harbor.xw.com/test/ruoyi-gateway:${T_DATE}_$1 .

echo "begin build ruoyi-auth "
cd ${BUILD_PATH}/ruoyi/auth && docker build -t harbor.xw.com/test/ruoyi-auth:${T_DATE}_$1 .

echo "begin build ruoyi-visual-monitor "
cd ${BUILD_PATH}/ruoyi/visual/monitor && docker build -t harbor.xw.com/test/ruoyi-monitor:${T_DATE}_$1 .

echo "begin build ruoyi-modules-system "
cd ${BUILD_PATH}/ruoyi/modules/system && docker build -t harbor.xw.com/test/ruoyi-modules-system:${T_DATE}_$1 .

echo "begin build ruoyi-modules-file "
cd ${BUILD_PATH}/ruoyi/modules/file && docker build -t harbor.xw.com/test/ruoyi-modules-file:${T_DATE}_$1 .

echo "begin build ruoyi-modules-job "
cd ${BUILD_PATH}/ruoyi/modules/job && docker build -t harbor.xw.com/test/ruoyi-modules-job:${T_DATE}_$1 .

echo "begin build ruoyi-modules-gen "
cd ${BUILD_PATH}/ruoyi/modules/gen && docker build -t harbor.xw.com/test/ruoyi-modules-gen:${T_DATE}_$1 .
